<?php
/**
 * 促销订单详情视图类
 */
 class SaleorderViewModel extends ViewModel {
     
    protected $viewFields = array(
        'orderDetail'  		=>array('sum(od.amount)' => 'amount', 'sum(od.total)' => 'total', 'sum(od.discount)' => 'discount', '_as' => 'od', '_type' => 'left'),
		'order'  			=>array('time', 'store', '_as'=>'o','_on'=>'o.id=od.`order`', '_type' => 'left'),
		'onsale'  			=>array('rulename' => 'sname', '_as'=>'s','_on'=>'s.id=od.saleid', '_type' => 'left'),
		'onsalecategory'  	=>array('name' => 'scname', '_as'=>'sc','_on'=>'sc.id=s.rulecategoryid', '_type' => 'left')
	);
	
 }
 
